function typeIs(obj, type) {
  return Object.prototype.toString.call(obj) === `object ${type}`;
}

/**
 * 删除对象中空属性
 * @param {*} obj
 */
export function removeNullProp(obj) {
  for (let key in obj) {
    if (obj[key] === null || obj[key] === undefined) delete obj[key];
    else {
      if (typeIs(obj[key], "Object")) removeNullProp(obj[key]);
    }
  }
}
